
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/continuum_mechanics/beam_problems.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:49 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Solving Beam Bending Problems using Singularity Functions &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
    <script src="../../../_static/jquery.js"></script>
    <script src="../../../_static/underscore.js"></script>
    <script src="../../../_static/doctools.js"></script>
    <script src="../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="beam_problems.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="Plotting" href="../../plotting.html" />
    <link rel="prev" title="Beam (Docstrings)" href="beam.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../plotting.html" title="Plotting"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="beam.html" title="Beam (Docstrings)"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="index.html" accesskey="U">Continuum Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Solving Beam Bending Problems using Singularity Functions</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="solving-beam-bending-problems-using-singularity-functions">
<h1>Solving Beam Bending Problems using Singularity Functions<a class="headerlink" href="#solving-beam-bending-problems-using-singularity-functions" title="Permalink to this headline">¶</a></h1>
<p>To make this document easier to read, enable pretty printing:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="o">*</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x y z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_printing</span><span class="p">(</span><span class="n">use_unicode</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">wrap_line</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</pre></div>
</div>
<section id="beam">
<h2>Beam<a class="headerlink" href="#beam" title="Permalink to this headline">¶</a></h2>
<p>A planar beam is a structural element that is capable of withstanding load
through resistance to internal shear and bending. Beams are characterized by
their length, constraints, cross-sectional second moment of area, and elastic
modulus. In SymPy, 2D beam objects are constructed by specifying the following
properties:</p>
<ul class="simple">
<li><p>Length</p></li>
<li><p>Elastic Modulus</p></li>
<li><p>Second Moment of Area</p></li>
<li><p>Variable : A symbol representing the location along the beam’s length. By
default, this is set to <code class="docutils literal notranslate"><span class="pre">Symbol(x)</span></code>.</p></li>
<li><dl class="simple">
<dt>Boundary Conditions</dt><dd><ul>
<li><p>bc_slope : Boundary conditions for slope.</p></li>
<li><p>bc_deflection : Boundary conditions for deflection.</p></li>
</ul>
</dd>
</dl>
</li>
<li><p>Load Distribution</p></li>
</ul>
<p>Once the above are specified, the following methods are used to compute useful
information about the loaded beam:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">solve_for_reaction_loads()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">shear_force()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bending_moment()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">slope()</span></code></p></li>
</ul>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>Below are examples of a variety two dimensional beam bending problems.</p>
<section id="example-1">
<h3>Example 1<a class="headerlink" href="#example-1" title="Permalink to this headline">¶</a></h3>
<p>A cantilever beam 9 meters in length has a distributed constant load of 8 kN/m
applied downward from the fixed end over a 5 meter distance. A counterclockwise
moment of 50 kN-m is applied 5 meters from the fixed end. Lastly, a downward
point load of 12 kN is applied at the free end of the beam.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>    y
    ^
    |
\\\\|
\\\\|    8 kN/m
\\\\|_________________
\\\\|| | | | | | | | |             12 kN
\\\\|V V V V V V V V V               |
\\\\|________________|_______________V
\\\\|                |               |
\\\\o - - - - - - - -⭯ 50 kN-m - - - | - - -&gt; x
\\\\|________________|_______________|
\\\\|                                :
\\\\|----------------|---------------|
           5.0 m            4.0 m
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The user is free to choose their own sign convention. In this case the
downward forces and counterclockwise bending moment being positive.</p>
</div>
<p>The beam must be initialized with the length, modulus of elasticity, and the
second moment of area. These quantities can be symbols or numbers.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">9</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
</pre></div>
</div>
<p>The three loads are applied to the beam using the <code class="docutils literal notranslate"><span class="pre">apply_load()</span></code> method. This
method supports point forces, point moments, and polynomial distributed loads
of any order, i.e. <span class="math notranslate nohighlight">\(c, cx, cx^2, cx^3, \ldots\)</span>.</p>
<p>The 12 kN point load is in the negative direction, at the location of 9 meters,
and the polynomial order is specified as -1:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">load</span></code> attribute can then be used to access the loading function in
singularity function form:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">          -1</span>
<span class="go">12⋅&lt;x - 9&gt;</span>
</pre></div>
</div>
<p>Similarly, the positive moment can be applied with a polynomial order -2:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
</pre></div>
</div>
<p>The distributed load is of order 0 and spans x=0 to x=5:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
</pre></div>
</div>
<p>The fixed end imposes two boundary conditions: 1) no vertical deflection and 2)
no rotation. These are specified by appending tuples of x values and the
corresponding deflection or slope values:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
</pre></div>
</div>
<p>These boundary conditions introduce an unknown reaction force and moment which
need to be applied to the beam to maintain static equilibrium:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">R</span><span class="p">,</span> <span class="n">M</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R, M&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">     -2        -1        0             -2            0             -1</span>
<span class="go">M⋅&lt;x&gt;   + R⋅&lt;x&gt;   + 8⋅&lt;x&gt;  + 50⋅&lt;x - 5&gt;   - 8⋅&lt;x - 5&gt;  + 12⋅&lt;x - 9&gt;</span>
</pre></div>
</div>
<p>These two variables can be solved for in terms of the applied loads and the
final loading can be displayed:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R</span><span class="p">,</span> <span class="n">M</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">    {M: 158, R: -52}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">           -2         -1        0             -2            0             -1</span>
<span class="go">    158⋅&lt;x&gt;   - 52⋅&lt;x&gt;   + 8⋅&lt;x&gt;  + 50⋅&lt;x - 5&gt;   - 8⋅&lt;x - 5&gt;  + 12⋅&lt;x - 9&gt;</span>
</pre></div>
</div>
<p>At this point, the beam is fully defined and the internal shear and bending
moments are calculated:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">          -1         0        1             -1            1             0</span>
<span class="go"> - 158⋅&lt;x&gt;   + 52⋅&lt;x&gt;  - 8⋅&lt;x&gt;  - 50⋅&lt;x - 5&gt;   + 8⋅&lt;x - 5&gt;  - 12⋅&lt;x - 9&gt;</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">             0         1        2             0            2             1</span>
<span class="go">    - 158⋅&lt;x&gt;  + 52⋅&lt;x&gt;  - 4⋅&lt;x&gt;  - 50⋅&lt;x - 5&gt;  + 4⋅&lt;x - 5&gt;  - 12⋅&lt;x - 9&gt;</span>
</pre></div>
</div>
<p>These can be visualized by calling the respective plot methods:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">plot_shear_force</span><span class="p">()</span>  
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">plot_bending_moment</span><span class="p">()</span>  
</pre></div>
</div>
<figure class="align-default" id="id1">
<img alt="../../../_images/beam_problems-11_00.png" class="plot-directive" src="../../../_images/beam_problems-11_00.png" />
<figcaption>
<p><span class="caption-text">(<a class="reference external" href="beam_problems-11_00.png">png</a>, <a class="reference external" href="beam_problems-11_00.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-11_00.pdf">pdf</a>)</span><a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>
</figcaption>
</figure>
<figure class="align-default" id="id2">
<img alt="../../../_images/beam_problems-11_01.png" class="plot-directive" src="../../../_images/beam_problems-11_01.png" />
<figcaption>
<p><span class="caption-text">(<a class="reference external" href="beam_problems-11_01.png">png</a>, <a class="reference external" href="beam_problems-11_01.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-11_01.pdf">pdf</a>)</span><a class="headerlink" href="#id2" title="Permalink to this image">¶</a></p>
</figcaption>
</figure>
<p>The beam will deform under load and the slope and deflection can be determined
with:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">  ⎛                            3                          3             ⎞</span>
<span class="go">  ⎜         1         2   4⋅&lt;x&gt;              1   4⋅&lt;x - 5&gt;             2⎟</span>
<span class="go"> -⎜- 158⋅&lt;x&gt;  + 26⋅&lt;x&gt;  - ────── - 50⋅&lt;x - 5&gt;  + ────────── - 6⋅&lt;x - 9&gt; ⎟</span>
<span class="go">  ⎝                         3                        3                  ⎠</span>
<span class="go"> ─────────────────────────────────────────────────────────────────────────</span>
<span class="go">                                    E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">  ⎛                  3      4                        4             ⎞</span>
<span class="go">  ⎜        2   26⋅&lt;x&gt;    &lt;x&gt;              2   &lt;x - 5&gt;             3⎟</span>
<span class="go"> -⎜- 79⋅&lt;x&gt;  + ─────── - ──── - 25⋅&lt;x - 5&gt;  + ──────── - 2⋅&lt;x - 9&gt; ⎟</span>
<span class="go">  ⎝               3       3                      3                 ⎠</span>
<span class="go"> ────────────────────────────────────────────────────────────────────</span>
<span class="go">                                 E⋅I</span>
</pre></div>
</div>
<p>The slope and deflection of the beam can be plotted so long as numbers are
provided for the modulus and second moment:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">plot_slope</span><span class="p">(</span><span class="n">subs</span><span class="o">=</span><span class="p">{</span><span class="n">E</span><span class="p">:</span> <span class="mf">20E9</span><span class="p">,</span> <span class="n">I</span><span class="p">:</span> <span class="mf">3.25E-6</span><span class="p">})</span>  
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">plot_deflection</span><span class="p">(</span><span class="n">subs</span><span class="o">=</span><span class="p">{</span><span class="n">E</span><span class="p">:</span> <span class="mf">20E9</span><span class="p">,</span> <span class="n">I</span><span class="p">:</span> <span class="mf">3.25E-6</span><span class="p">})</span>  
</pre></div>
</div>
<figure class="align-default" id="id3">
<img alt="../../../_images/beam_problems-13_00.png" class="plot-directive" src="../../../_images/beam_problems-13_00.png" />
<figcaption>
<p><span class="caption-text">(<a class="reference external" href="beam_problems-13_00.png">png</a>, <a class="reference external" href="beam_problems-13_00.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-13_00.pdf">pdf</a>)</span><a class="headerlink" href="#id3" title="Permalink to this image">¶</a></p>
</figcaption>
</figure>
<figure class="align-default" id="id4">
<img alt="../../../_images/beam_problems-13_01.png" class="plot-directive" src="../../../_images/beam_problems-13_01.png" />
<figcaption>
<p><span class="caption-text">(<a class="reference external" href="beam_problems-13_01.png">png</a>, <a class="reference external" href="beam_problems-13_01.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-13_01.pdf">pdf</a>)</span><a class="headerlink" href="#id4" title="Permalink to this image">¶</a></p>
</figcaption>
</figure>
<p>All of the plots can be shown in one figure with:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">plot_loading_results</span><span class="p">(</span><span class="n">subs</span><span class="o">=</span><span class="p">{</span><span class="n">E</span><span class="p">:</span> <span class="mf">20E9</span><span class="p">,</span> <span class="n">I</span><span class="p">:</span> <span class="mf">3.25E-6</span><span class="p">})</span>  
</pre></div>
</div>
<p>(<a class="reference external" href="beam_problems-14.png">png</a>, <a class="reference external" href="beam_problems-14.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-14.pdf">pdf</a>)</p>
<figure class="align-default">
<img alt="../../../_images/beam_problems-14.png" class="plot-directive" src="../../../_images/beam_problems-14.png" />
</figure>
</section>
<section id="example-2">
<h3>Example 2<a class="headerlink" href="#example-2" title="Permalink to this headline">¶</a></h3>
<p>There is a beam of length 30 meters. A moment of magnitude 120 Nm is
applied in the counter-clockwise direction at the end of the beam. A point load
of magnitude 8 N is applied from the top of the beam at the starting
point. There are two simple supports below the beam. One at the end
and another one at a distance of 10 meters from the start. The
deflection is restricted at both the supports.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>|| 8 N                                       ⭯ 120 Nm
\/______________________________________________|
|_______________________________________________|
            /\                                 /\
|------------|---------------------------------|
    10 m                  20 m
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Using the sign convention of downward forces and counterclockwise moment
being positive.</p>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1, R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">30</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">120</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">30</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">    {R₁: -18, R₂: 10}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">         -1              -1               -2              -1</span>
<span class="go">    8⋅&lt;x&gt;   - 18⋅&lt;x - 10&gt;   + 120⋅&lt;x - 30&gt;   + 10⋅&lt;x - 30&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">           0              0               -1              0</span>
<span class="go">    - 8⋅&lt;x&gt;  + 18⋅&lt;x - 10&gt;  - 120⋅&lt;x - 30&gt;   - 10⋅&lt;x - 30&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">           1              1               0              1</span>
<span class="go">    - 8⋅&lt;x&gt;  + 18⋅&lt;x - 10&gt;  - 120⋅&lt;x - 30&gt;  - 10⋅&lt;x - 30&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">         2             2               1             2   1600</span>
<span class="go">    4⋅&lt;x&gt;  - 9⋅&lt;x - 10&gt;  + 120⋅&lt;x - 30&gt;  + 5⋅&lt;x - 30&gt;  - ────</span>
<span class="go">                                                          3</span>
<span class="go">    ─────────────────────────────────────────────────────────</span>
<span class="go">                               E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">                    3                                          3</span>
<span class="go">      1600⋅x   4⋅&lt;x&gt;              3              2   5⋅&lt;x - 30&gt;</span>
<span class="go">    - ────── + ────── - 3⋅&lt;x - 10&gt;  + 60⋅&lt;x - 30&gt;  + ─────────── + 4000</span>
<span class="go">        3        3                                        3</span>
<span class="go">    ───────────────────────────────────────────────────────────────────</span>
<span class="go">                                    E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-3">
<h3>Example 3<a class="headerlink" href="#example-3" title="Permalink to this headline">¶</a></h3>
<p>A beam of length 6 meters is having a roller support at the start and a hinged
support at the end. A counterclockwise moment of 1.5 kN-m is applied at the mid
of the beam. A constant distributed load of 3 kN/m and a ramp load of 1 kN/m/m is
applied from the mid till the end of the beam.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                            ramp load = 1 KN/m/m
                          constant load = 3 KN/m
                       |------------------------|
                     ⭯ 1.5 KN-m
 ______________________|________________________
|_______________________________________________|
o                      |                       /\
|----------------------|-----------------------|
        3.0 m                     3.0 m
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Using the sign convention of downward forces and counterclockwise moment
being positive.</p>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">plot</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1, R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="o">-</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="mi">6</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">   {R₁: -11/4, R₂: -43/4}</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">            -1            -2                                     -1</span>
<span class="go">      11⋅&lt;x&gt;     3⋅&lt;x - 3&gt;              0          1   43⋅&lt;x - 6&gt;</span>
<span class="go">    - ──────── - ─────────── + 3⋅&lt;x - 3&gt;  + &lt;x - 3&gt;  - ────────────</span>
<span class="go">         4            2                                     4</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">plot</span><span class="p">(</span><span class="n">b</span><span class="o">.</span><span class="n">load</span><span class="p">)</span>  
</pre></div>
</div>
<p>(<a class="reference external" href="beam_problems-16.png">png</a>, <a class="reference external" href="beam_problems-16.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-16.pdf">pdf</a>)</p>
<figure class="align-default">
<img alt="../../../_images/beam_problems-16.png" class="plot-directive" src="../../../_images/beam_problems-16.png" />
</figure>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">            0            -1                       2             0</span>
<span class="go">      11⋅&lt;x&gt;    3⋅&lt;x - 3&gt;              1   &lt;x - 3&gt;    43⋅&lt;x - 6&gt;</span>
<span class="go">      ─────── + ─────────── - 3⋅&lt;x - 3&gt;  - ──────── + ───────────</span>
<span class="go">         4           2                        2            4</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">            1            0            2          3             1</span>
<span class="go">      11⋅&lt;x&gt;    3⋅&lt;x - 3&gt;    3⋅&lt;x - 3&gt;    &lt;x - 3&gt;    43⋅&lt;x - 6&gt;</span>
<span class="go">      ─────── + ────────── - ────────── - ──────── + ───────────</span>
<span class="go">         4          2            2           6            4</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">            2            1          3          4             2</span>
<span class="go">      11⋅&lt;x&gt;    3⋅&lt;x - 3&gt;    &lt;x - 3&gt;    &lt;x - 3&gt;    43⋅&lt;x - 6&gt;    78</span>
<span class="go">    - ─────── - ────────── + ──────── + ──────── - ─────────── + ──</span>
<span class="go">         8          2           2          24           8        5</span>
<span class="go">    ───────────────────────────────────────────────────────────────</span>
<span class="go">                                 E⋅I</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">                 3            2          4          5             3</span>
<span class="go">    78⋅x   11⋅&lt;x&gt;    3⋅&lt;x - 3&gt;    &lt;x - 3&gt;    &lt;x - 3&gt;    43⋅&lt;x - 6&gt;</span>
<span class="go">    ──── - ─────── - ────────── + ──────── + ──────── - ───────────</span>
<span class="go">     5        24         4           8         120           24</span>
<span class="go">    ───────────────────────────────────────────────────────────────</span>
<span class="go">                                 E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-4">
<h3>Example 4<a class="headerlink" href="#example-4" title="Permalink to this headline">¶</a></h3>
<p>An overhanging beam of length 8 meters is pinned at 1 meter from starting point
and supported by a roller 1 meter before the other end. It is subjected
to a distributed constant load of 10 KN/m from the starting point till
2 meters away from it. Two point loads of 20KN and 8KN are applied at
5 meters and 7.5 meters away from the starting point respectively.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                                      <span class="o">---&gt;</span> <span class="n">x</span>
                                      <span class="o">|</span>
                                      <span class="n">v</span> <span class="n">y</span>
  <span class="mi">10</span> <span class="n">KN</span><span class="o">/</span><span class="n">m</span>
<span class="n">_____________</span>                 <span class="mi">20</span> <span class="n">KN</span>         <span class="mi">8</span> <span class="n">KN</span>
<span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>                  <span class="o">|</span>             <span class="o">|</span>
<span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span>                  <span class="n">V</span>             <span class="n">V</span>
 <span class="n">_______________________________________________</span>
<span class="o">|</span><span class="n">_______________________________________________</span><span class="o">|</span>
      <span class="o">/</span>\                                  <span class="n">O</span>
<span class="o">|-----|------|-----------------|----------|--|--|</span>
   <span class="mi">1</span><span class="n">m</span>    <span class="mi">1</span><span class="n">m</span>          <span class="mi">3</span><span class="n">m</span>              <span class="mi">2</span><span class="n">m</span>   <span class="mf">.5</span><span class="n">m</span> <span class="mf">.5</span><span class="n">m</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span><span class="n">I</span><span class="p">,</span><span class="n">M</span><span class="p">,</span><span class="n">V</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E I M V&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span><span class="n">I</span><span class="p">,</span><span class="n">R1</span><span class="p">,</span><span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E I R1 R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mf">7.5</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">{R₁: -26.0, R₂: -22.0}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">      0               -1             0             -1               -1              -1</span>
<span class="go">10⋅&lt;x&gt;  - 26.0⋅&lt;x - 1&gt;   - 10⋅&lt;x - 2&gt;  + 20⋅&lt;x - 5&gt;   - 22.0⋅&lt;x - 7&gt;   + 8⋅&lt;x - 7.5&gt;</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">        1               0             1             0               0              0</span>
<span class="go">- 10⋅&lt;x&gt;  + 26.0⋅&lt;x - 1&gt;  + 10⋅&lt;x - 2&gt;  - 20⋅&lt;x - 5&gt;  + 22.0⋅&lt;x - 7&gt;  - 8⋅&lt;x - 7.5&gt;</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">       2               1            2             1               1              1</span>
<span class="go">- 5⋅&lt;x&gt;  + 26.0⋅&lt;x - 1&gt;  + 5⋅&lt;x - 2&gt;  - 20⋅&lt;x - 5&gt;  + 22.0⋅&lt;x - 7&gt;  - 8⋅&lt;x - 7.5&gt;</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">     3                            3</span>
<span class="go">5⋅&lt;x&gt;                2   5⋅&lt;x - 2&gt;              2               2              2</span>
<span class="go">────── - 13.0⋅&lt;x - 1&gt;  - ────────── + 10⋅&lt;x - 5&gt;  - 11.0⋅&lt;x - 7&gt;  + 4⋅&lt;x - 7.5&gt;  + 28.2916666666667</span>
<span class="go">  3                          3</span>
<span class="go">───────────────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                                                E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">                          4                                        4             3                                          3</span>
<span class="go">                     5⋅&lt;x&gt;                            3   5⋅&lt;x - 2&gt;    10⋅&lt;x - 5&gt;                            3   4⋅&lt;x - 7.5&gt;</span>
<span class="go">28.2916666666667⋅x + ────── - 4.33333333333333⋅&lt;x - 1&gt;  - ────────── + ─────────── - 3.66666666666667⋅&lt;x - 7&gt;  + ──────────── - 28.7083333333333</span>
<span class="go">                       12                                     12            3                                         3</span>
<span class="go">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                                                                      E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-5">
<h3>Example 5<a class="headerlink" href="#example-5" title="Permalink to this headline">¶</a></h3>
<p>A cantilever beam of length 6 meters is under downward distributed constant
load with magnitude of 4.0 KN/m from starting point till 2 meters away
from it. A ramp load of 1 kN/m/m applied from the mid till the end of
the beam. A point load of 12KN is also applied in same direction 4 meters
away from start.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>  <span class="o">---&gt;</span> <span class="n">x</span>                             <span class="o">.</span>
  <span class="o">|</span>                                <span class="o">.</span> <span class="o">|</span>
  <span class="n">v</span> <span class="n">y</span>                    <span class="mi">12</span> <span class="n">KN</span>   <span class="o">.</span> <span class="o">|</span> <span class="o">|</span>
                           <span class="o">|</span>   <span class="o">.</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>
                           <span class="n">V</span> <span class="o">.</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>
\\\\<span class="o">|</span>   <span class="mi">4</span> <span class="n">KN</span><span class="o">/</span><span class="n">m</span>             <span class="o">.</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>
\\\\<span class="o">|</span><span class="n">___________</span>         <span class="o">.</span> <span class="mi">1</span> <span class="n">KN</span><span class="o">/</span><span class="n">m</span><span class="o">/</span><span class="n">m</span><span class="o">|</span> <span class="o">|</span>
\\\\<span class="o">||</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>       <span class="o">.</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span>
\\\\<span class="o">|</span><span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span> <span class="n">V</span>     <span class="o">|---------------|</span>
\\\\<span class="o">|</span><span class="n">________________________________</span>
\\\\<span class="o">|</span><span class="n">________________________________</span><span class="o">|</span>
\\\\<span class="o">|</span>          <span class="p">:</span>          <span class="p">:</span>          <span class="p">:</span>
\\\\<span class="o">|----------|-----|----|----------|</span>
        <span class="mf">2.0</span> <span class="n">m</span>     <span class="mi">1</span><span class="n">m</span>   <span class="mi">1</span><span class="n">m</span>      <span class="mf">2.0</span> <span class="n">m</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span><span class="n">I</span><span class="p">,</span><span class="n">M</span><span class="p">,</span><span class="n">V</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E I M V&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">V</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">V</span><span class="p">,</span> <span class="n">M</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">{M: 157/2, V: -49/2}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">       -2         -1</span>
<span class="go">157⋅&lt;x&gt;     49⋅&lt;x&gt;          0            0          1             -1            0          1</span>
<span class="go">───────── - ──────── + 4⋅&lt;x&gt;  - 4⋅&lt;x - 2&gt;  + &lt;x - 3&gt;  + 12⋅&lt;x - 4&gt;   - 3⋅&lt;x - 6&gt;  - &lt;x - 6&gt;</span>
<span class="go">    2          2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">          -1         0                                2                                     2</span>
<span class="go">   157⋅&lt;x&gt;     49⋅&lt;x&gt;        1            1    &lt;x - 3&gt;             0            1    &lt;x - 6&gt;</span>
<span class="go">- ───────── + ─────── - 4⋅&lt;x&gt;  + 4⋅&lt;x - 2&gt;  - ──────── - 12⋅&lt;x - 4&gt;  + 3⋅&lt;x - 6&gt;  + ────────</span>
<span class="go">      2          2                                2                                    2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">         0         1                                3                          2          3</span>
<span class="go">  157⋅&lt;x&gt;    49⋅&lt;x&gt;         2            2   &lt;x - 3&gt;              1   3⋅&lt;x - 6&gt;    &lt;x - 6&gt;</span>
<span class="go">- ──────── + ─────── - 2⋅&lt;x&gt;  + 2⋅&lt;x - 2&gt;  - ──────── - 12⋅&lt;x - 4&gt;  + ────────── + ────────</span>
<span class="go">     2          2                               6                         2           6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go"> ⎛         1         2        3            3          4                       3          4⎞</span>
<span class="go"> ⎜  157⋅&lt;x&gt;    49⋅&lt;x&gt;    2⋅&lt;x&gt;    2⋅&lt;x - 2&gt;    &lt;x - 3&gt;             2   &lt;x - 6&gt;    &lt;x - 6&gt; ⎟</span>
<span class="go">-⎜- ──────── + ─────── - ────── + ────────── - ──────── - 6⋅&lt;x - 4&gt;  + ──────── + ────────⎟</span>
<span class="go"> ⎝     2          4        3          3           24                      2          24   ⎠</span>
<span class="go">────────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                                            E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go"> ⎛         2         3      4          4          5                       4          5⎞</span>
<span class="go"> ⎜  157⋅&lt;x&gt;    49⋅&lt;x&gt;    &lt;x&gt;    &lt;x - 2&gt;    &lt;x - 3&gt;             3   &lt;x - 6&gt;    &lt;x - 6&gt; ⎟</span>
<span class="go">-⎜- ──────── + ─────── - ──── + ──────── - ──────── - 2⋅&lt;x - 4&gt;  + ──────── + ────────⎟</span>
<span class="go"> ⎝     4          12      6        6         120                      8         120   ⎠</span>
<span class="go">────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                                          E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-6">
<h3>Example 6<a class="headerlink" href="#example-6" title="Permalink to this headline">¶</a></h3>
<p>An overhanging beam of length 11 meters is subjected to a distributed constant
load of 2 KN/m from 2 meters away from the starting point till 6 meters away
from it. It is pinned at the starting point and is resting over a roller 8 meters
away from that end. Also a counterclockwise moment of 5 KN-m is applied at the
overhanging end.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>               2 KN/m                         ---&gt; x
           _________________                  |
           | | | | | | | | |                  v y
           V V V V V V V V V                        ⭯ 5 KN-m
  ____________________________________________________|
 O____________________________________________________|
/ \                                   /\
 |--------|----------------|----------|---------------|
     2m           4m            2m            3m
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1, R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">11</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">{R₁: -37/8, R₂: -27/8}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">        -1                                       -1</span>
<span class="go">  37⋅&lt;x&gt;              0            0   27⋅&lt;x - 8&gt;               -2</span>
<span class="go">- ──────── + 2⋅&lt;x - 2&gt;  - 2⋅&lt;x - 6&gt;  - ──────────── + 5⋅&lt;x - 11&gt;</span>
<span class="go">     8                                      8</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">        0                                       0</span>
<span class="go">  37⋅&lt;x&gt;             1            1   27⋅&lt;x - 8&gt;              -1</span>
<span class="go">  ─────── - 2⋅&lt;x - 2&gt;  + 2⋅&lt;x - 6&gt;  + ─────────── - 5⋅&lt;x - 11&gt;</span>
<span class="go">     8                                     8</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">        1                                   1</span>
<span class="go">  37⋅&lt;x&gt;           2          2   27⋅&lt;x - 8&gt;              0</span>
<span class="go">  ─────── - &lt;x - 2&gt;  + &lt;x - 6&gt;  + ─────────── - 5⋅&lt;x - 11&gt;</span>
<span class="go">     8                                 8</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">        2          3          3             2</span>
<span class="go">  37⋅&lt;x&gt;    &lt;x - 2&gt;    &lt;x - 6&gt;    27⋅&lt;x - 8&gt;              1</span>
<span class="go">- ─────── + ──────── - ──────── - ─────────── + 5⋅&lt;x - 11&gt;  + 36</span>
<span class="go">     16        3          3            16</span>
<span class="go">────────────────────────────────────────────────────────────────</span>
<span class="go">                              E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">             3          4          4            3             2</span>
<span class="go">       37⋅&lt;x&gt;    &lt;x - 2&gt;    &lt;x - 6&gt;    9⋅&lt;x - 8&gt;    5⋅&lt;x - 11&gt;</span>
<span class="go">36⋅x - ─────── + ──────── - ──────── - ────────── + ───────────</span>
<span class="go">          48        12         12          16            2</span>
<span class="go">───────────────────────────────────────────────────────────────</span>
<span class="go">                              E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-7">
<h3>Example 7<a class="headerlink" href="#example-7" title="Permalink to this headline">¶</a></h3>
<p>There is a beam of length <code class="docutils literal notranslate"><span class="pre">l</span></code>, fixed at both ends. A concentrated point load
of magnitude <code class="docutils literal notranslate"><span class="pre">F</span></code> is applied in downward direction at mid-point of the
beam.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                                      <span class="o">^</span> <span class="n">y</span>
                                      <span class="o">|</span>
                                      <span class="o">---&gt;</span> <span class="n">x</span>
\\\\<span class="o">|</span>                  <span class="n">F</span>                  <span class="o">|</span>\\\\
\\\\<span class="o">|</span>                  <span class="o">|</span>                  <span class="o">|</span>\\\\
\\\\<span class="o">|</span>                  <span class="n">V</span>                  <span class="o">|</span>\\\\
\\\\<span class="o">|</span><span class="n">_____________________________________</span><span class="o">|</span>\\\\
\\\\<span class="o">|</span><span class="n">_____________________________________</span><span class="o">|</span>\\\\
\\\\<span class="o">|</span>                  <span class="p">:</span>                  <span class="o">|</span>\\\\
\\\\<span class="o">|</span>                  <span class="p">:</span>                  <span class="o">|</span>\\\\
\\\\<span class="o">|------------------|------------------|</span>\\\\
             <span class="n">l</span><span class="o">/</span><span class="mi">2</span>                <span class="n">l</span><span class="o">/</span><span class="mi">2</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">F</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E I F&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">l</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;l&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="n">l</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span><span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1  R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M1</span><span class="p">,</span> <span class="n">M2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;M1, M2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M2</span><span class="p">,</span> <span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="o">-</span><span class="n">F</span><span class="p">,</span> <span class="n">l</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),(</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),(</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">,</span> <span class="n">M1</span><span class="p">,</span> <span class="n">M2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">⎧    -F⋅l       F⋅l      F      F⎫</span>
<span class="go">⎨M₁: ─────, M₂: ───, R₁: ─, R₂: ─⎬</span>
<span class="go">⎩      8         8       2      2⎭</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">         -2               -2        -1              -1             -1</span>
<span class="go">  F⋅l⋅&lt;x&gt;     F⋅l⋅&lt;-l + x&gt;     F⋅&lt;x&gt;          l          F⋅&lt;-l + x&gt;</span>
<span class="go">- ───────── + ────────────── + ─────── - F⋅&lt;- ─ + x&gt;   + ────────────</span>
<span class="go">      8             8             2           2               2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">         -1               -1        0              0             0</span>
<span class="go">  F⋅l⋅&lt;x&gt;     F⋅l⋅&lt;-l + x&gt;     F⋅&lt;x&gt;         l         F⋅&lt;-l + x&gt;</span>
<span class="go">  ───────── - ────────────── - ────── + F⋅&lt;- ─ + x&gt;  - ───────────</span>
<span class="go">      8             8            2           2              2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">         0               0        1              1             1</span>
<span class="go">  F⋅l⋅&lt;x&gt;    F⋅l⋅&lt;-l + x&gt;    F⋅&lt;x&gt;         l         F⋅&lt;-l + x&gt;</span>
<span class="go">  ──────── - ───────────── - ────── + F⋅&lt;- ─ + x&gt;  - ───────────</span>
<span class="go">     8             8           2           2              2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go"> ⎛                                               2              ⎞</span>
<span class="go"> ⎜                                         l                    ⎟</span>
<span class="go"> ⎜       1               1        2   F⋅&lt;- ─ + x&gt;              2⎟</span>
<span class="go"> ⎜F⋅l⋅&lt;x&gt;    F⋅l⋅&lt;-l + x&gt;    F⋅&lt;x&gt;         2         F⋅&lt;-l + x&gt; ⎟</span>
<span class="go">-⎜──────── - ───────────── - ────── + ──────────── - ───────────⎟</span>
<span class="go"> ⎝   8             8           4           2              4     ⎠</span>
<span class="go">──────────────────────────────────────────────────────────────────</span>
<span class="go">                               E⋅I</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go"> ⎛                                               3              ⎞</span>
<span class="go"> ⎜                                         l                    ⎟</span>
<span class="go"> ⎜       2               2        3   F⋅&lt;- ─ + x&gt;              3⎟</span>
<span class="go"> ⎜F⋅l⋅&lt;x&gt;    F⋅l⋅&lt;-l + x&gt;    F⋅&lt;x&gt;         2         F⋅&lt;-l + x&gt; ⎟</span>
<span class="go">-⎜──────── - ───────────── - ────── + ──────────── - ───────────⎟</span>
<span class="go"> ⎝   16            16          12          6              12    ⎠</span>
<span class="go">──────────────────────────────────────────────────────────────────</span>
<span class="go">                               E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-8">
<h3>Example 8<a class="headerlink" href="#example-8" title="Permalink to this headline">¶</a></h3>
<p>There is a beam of length <code class="docutils literal notranslate"><span class="pre">4*l</span></code>, having a hinge connector at the middle. It
is having a fixed support at the start and also has two rollers at a distance
of <code class="docutils literal notranslate"><span class="pre">l</span></code> and <code class="docutils literal notranslate"><span class="pre">4*l</span></code> from the starting point. A concentrated point load <code class="docutils literal notranslate"><span class="pre">P</span></code> is also
applied at a distance of <code class="docutils literal notranslate"><span class="pre">3*l</span></code> from the starting point.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                                                   <span class="o">---&gt;</span> <span class="n">x</span>
\\\\<span class="o">|</span>                                 <span class="n">P</span>            <span class="o">|</span>
\\\\<span class="o">|</span>                                 <span class="o">|</span>            <span class="n">v</span> <span class="n">y</span>
\\\\<span class="o">|</span>                                 <span class="n">V</span>
\\\\<span class="o">|</span><span class="n">_____________________</span> <span class="n">_______________________</span>
\\\\<span class="o">|</span><span class="n">_____________________O_______________________</span><span class="o">|</span>
\\\\<span class="o">|</span>          <span class="o">/</span>\                     <span class="p">:</span>          <span class="o">/</span>\
\\\\<span class="o">|</span>         <span class="n">oooo</span>                    <span class="p">:</span>         <span class="n">oooo</span>
\\\\<span class="o">|----------|-----------|----------|-----------|</span>
         <span class="n">l</span>           <span class="n">l</span>          <span class="n">l</span>            <span class="n">l</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">l</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;l&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span> <span class="n">M1</span><span class="p">,</span> <span class="n">R2</span><span class="p">,</span> <span class="n">R3</span><span class="p">,</span> <span class="n">P</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1 M1 R2 R3 P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b1</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b2</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">b1</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">b2</span><span class="p">,</span> <span class="s2">&quot;hinge&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R3</span><span class="p">,</span> <span class="mi">4</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">P</span><span class="p">,</span> <span class="mi">3</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">,</span> <span class="n">R3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">⎧    -P⋅l       3⋅P      -5⋅P       -P ⎫</span>
<span class="go">⎨M₁: ─────, R₁: ───, R₂: ─────, R₃: ───⎬</span>
<span class="go">⎩      4         4         4         2 ⎭</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">         -2          -1               -1                                -1</span>
<span class="go">  P⋅l⋅&lt;x&gt;     3⋅P⋅&lt;x&gt;     5⋅P⋅&lt;-l + x&gt;                 -1   P⋅&lt;-4⋅l + x&gt;</span>
<span class="go">- ───────── + ───────── - ────────────── + P⋅&lt;-3⋅l + x&gt;   - ──────────────</span>
<span class="go">      4           4             4                                 2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">         -1          0               0                               0</span>
<span class="go">  P⋅l⋅&lt;x&gt;     3⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;                0   P⋅&lt;-4⋅l + x&gt;</span>
<span class="go">  ───────── - ──────── + ───────────── - P⋅&lt;-3⋅l + x&gt;  + ─────────────</span>
<span class="go">      4          4             4                               2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">         0          1               1                               1</span>
<span class="go">  P⋅l⋅&lt;x&gt;    3⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;                1   P⋅&lt;-4⋅l + x&gt;</span>
<span class="go">  ──────── - ──────── + ───────────── - P⋅&lt;-3⋅l + x&gt;  + ─────────────</span>
<span class="go">     4          4             4                               2</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">⎛     2               2               2               2⎞               ⎛         1          2               2               2⎞        ⎛         1          2               2               2⎞</span>
<span class="go">⎜5⋅P⋅l    P⋅&lt;-2⋅l + x&gt;    P⋅&lt;-3⋅l + x&gt;    P⋅&lt;-4⋅l + x&gt; ⎟           0   ⎜  P⋅l⋅&lt;x&gt;    3⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt; ⎟    0   ⎜  P⋅l⋅&lt;x&gt;    3⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt; ⎟           0</span>
<span class="go">⎜────── - ───────────── + ───────────── - ─────────────⎟⋅&lt;-2⋅l + x&gt;    ⎜- ──────── + ──────── - ───────────── + ─────────────⎟⋅&lt;x&gt;    ⎜- ──────── + ──────── - ───────────── + ─────────────⎟⋅&lt;-2⋅l + x&gt;</span>
<span class="go">⎝  48           4               2               4      ⎠               ⎝     4          8             8               4      ⎠        ⎝     4          8             8               4      ⎠</span>
<span class="go">──────────────────────────────────────────────────────────────────── + ──────────────────────────────────────────────────────────── - ───────────────────────────────────────────────────────────────────</span>
<span class="go">                                E⋅I                                                                E⋅I                                                                E⋅I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">⎛         2        3               3               3⎞        ⎛         2        3               3               3⎞               ⎛     3        2                          3               3               3⎞</span>
<span class="go">⎜  P⋅l⋅&lt;x&gt;    P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt; ⎟    0   ⎜  P⋅l⋅&lt;x&gt;    P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt; ⎟           0   ⎜7⋅P⋅l    5⋅P⋅l ⋅(-2⋅l + x)   P⋅&lt;-2⋅l + x&gt;    P⋅&lt;-3⋅l + x&gt;    P⋅&lt;-4⋅l + x&gt; ⎟           0</span>
<span class="go">⎜- ──────── + ────── - ───────────── + ─────────────⎟⋅&lt;x&gt;    ⎜- ──────── + ────── - ───────────── + ─────────────⎟⋅&lt;-2⋅l + x&gt;    ⎜────── + ───────────────── - ───────────── + ───────────── - ─────────────⎟⋅&lt;-2⋅l + x&gt;</span>
<span class="go">⎝     8         8            24              12     ⎠        ⎝     8         8            24              12     ⎠               ⎝  24             48                12              6               12     ⎠</span>
<span class="go">────────────────────────────────────────────────────────── - ───────────────────────────────────────────────────────────────── + ────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                            E⋅I                                                              E⋅I                                                                            E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-9">
<h3>Example 9<a class="headerlink" href="#example-9" title="Permalink to this headline">¶</a></h3>
<p>There is a cantilever beam of length 4 meters. For first 2 meters
its moment of inertia is <code class="docutils literal notranslate"><span class="pre">1.5*I</span></code> and <code class="docutils literal notranslate"><span class="pre">I</span></code> for the rest.
A pointload of magnitude 20 N is applied from the top at its free end.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                                           <span class="o">---&gt;</span> <span class="n">x</span>
\\\\<span class="o">|</span>                                      <span class="o">|</span>
\\\\<span class="o">|</span>                               <span class="mi">20</span> <span class="n">N</span>   <span class="n">v</span> <span class="n">y</span>
\\\\<span class="o">|</span><span class="n">________________</span>                <span class="o">|</span>
\\\\<span class="o">|</span>                <span class="o">|</span><span class="n">_______________V</span>
\\\\<span class="o">|</span>      <span class="mf">1.5</span><span class="o">*</span><span class="n">I</span>      <span class="n">_______I_______</span><span class="o">|</span>
\\\\<span class="o">|</span><span class="n">________________</span><span class="o">|</span>
\\\\<span class="o">|</span>                                <span class="p">:</span>
\\\\<span class="o">|----------------|---------------|</span>
           <span class="mf">2.0</span> <span class="n">m</span>            <span class="mf">2.0</span> <span class="n">m</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;R1, R2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b1</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="mf">1.5</span><span class="o">*</span><span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b2</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">b1</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">b2</span><span class="p">,</span> <span class="s2">&quot;fixed&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">R2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">R1</span><span class="p">,</span> <span class="n">R2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">      -2         -1             -1</span>
<span class="go">80⋅&lt;x&gt;   - 20⋅&lt;x&gt;   + 20⋅&lt;x - 4&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">        -1         0             0</span>
<span class="go">- 80⋅&lt;x&gt;   + 20⋅&lt;x&gt;  - 20⋅&lt;x - 4&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">        0         1             1</span>
<span class="go">- 80⋅&lt;x&gt;  + 20⋅&lt;x&gt;  - 20⋅&lt;x - 4&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">⎛          1         2             2             ⎞</span>
<span class="go">⎜  - 80⋅&lt;x&gt;  + 10⋅&lt;x&gt;  - 10⋅&lt;x - 4&gt;    120       ⎟</span>
<span class="go">⎜  ───────────────────────────────── + ───       ⎟                              ⎛        1         2             2⎞    0                     ⎛        1         2             2⎞        0</span>
<span class="go">⎜                  I                    I    80.0⎟        0   0.666666666666667⋅⎝- 80⋅&lt;x&gt;  + 10⋅&lt;x&gt;  - 10⋅&lt;x - 4&gt; ⎠⋅&lt;x&gt;    0.666666666666667⋅⎝- 80⋅&lt;x&gt;  + 10⋅&lt;x&gt;  - 10⋅&lt;x - 4&gt; ⎠⋅&lt;x - 2&gt;</span>
<span class="go">⎜- ─────────────────────────────────────── + ────⎟⋅&lt;x - 2&gt;  - ────────────────────────────────────────────────────────── + ──────────────────────────────────────────────────────────────</span>
<span class="go">⎝                     E                      E⋅I ⎠                                       E⋅I                                                            E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-10">
<h3>Example 10<a class="headerlink" href="#example-10" title="Permalink to this headline">¶</a></h3>
<p>A combined beam, with constant flexural rigidity <code class="docutils literal notranslate"><span class="pre">E*I</span></code>, is formed by joining
a Beam of length <code class="docutils literal notranslate"><span class="pre">2*l</span></code> to the right of another Beam of length <code class="docutils literal notranslate"><span class="pre">l</span></code>. The whole beam
is fixed at both of its ends. A point load of magnitude <code class="docutils literal notranslate"><span class="pre">P</span></code> is also applied
from the top at a distance of <code class="docutils literal notranslate"><span class="pre">2*l</span></code> from starting point.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>                                      <span class="o">---&gt;</span> <span class="n">x</span>
                                      <span class="o">|</span>
\\\\<span class="o">|</span>                         <span class="n">P</span>       <span class="n">v</span> <span class="n">y</span> <span class="o">|</span>\\\\
\\\\<span class="o">|</span>                         <span class="o">|</span>           <span class="o">|</span>\\\\
\\\\<span class="o">|</span>                         <span class="n">V</span>           <span class="o">|</span>\\\\
\\\\<span class="o">|</span><span class="n">____________</span> <span class="n">________________________</span><span class="o">|</span>\\\\
\\\\<span class="o">|</span><span class="n">____________O________________________</span><span class="o">|</span>\\\\
\\\\<span class="o">|</span>            <span class="p">:</span>            <span class="p">:</span>           <span class="o">|</span>\\\\
\\\\<span class="o">|</span>            <span class="p">:</span>            <span class="p">:</span>           <span class="o">|</span>\\\\
\\\\<span class="o">|------------|------------|-----------|</span>\\\\
         <span class="n">l</span>            <span class="n">l</span>            <span class="n">l</span>
</pre></div>
</div>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.continuum_mechanics.beam</span> <span class="kn">import</span> <span class="n">Beam</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E</span><span class="p">,</span> <span class="n">I</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;E, I&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">l</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;l&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b1</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="n">l</span> <span class="p">,</span><span class="n">E</span><span class="p">,</span><span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b2</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">l</span> <span class="p">,</span><span class="n">E</span><span class="p">,</span><span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">b1</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">b2</span><span class="p">,</span><span class="s2">&quot;hinge&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">M1</span><span class="p">,</span> <span class="n">A1</span><span class="p">,</span> <span class="n">M2</span><span class="p">,</span> <span class="n">A2</span><span class="p">,</span> <span class="n">P</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;M1 A1 M2 A2 P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">A1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="mi">0</span> <span class="p">,</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">P</span><span class="p">,</span> <span class="mi">2</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">A2</span><span class="p">,</span> <span class="mi">3</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="n">M2</span><span class="p">,</span> <span class="mi">3</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_slope</span><span class="o">=</span><span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bc_deflection</span><span class="o">=</span><span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">l</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">solve_for_reaction_loads</span><span class="p">(</span><span class="n">M1</span><span class="p">,</span> <span class="n">A1</span><span class="p">,</span> <span class="n">M2</span><span class="p">,</span> <span class="n">A2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">reaction_loads</span>
<span class="go">⎧    -5⋅P       -13⋅P       5⋅P⋅l      -4⋅P⋅l ⎫</span>
<span class="go">⎨A₁: ─────, A₂: ──────, M₁: ─────, M₂: ───────⎬</span>
<span class="go">⎩      18         18          18          9   ⎭</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">load</span>
<span class="go">         -2                   -2          -1                                   -1</span>
<span class="go">5⋅P⋅l⋅&lt;x&gt;     4⋅P⋅l⋅&lt;-3⋅l + x&gt;     5⋅P⋅&lt;x&gt;                 -1   13⋅P⋅&lt;-3⋅l + x&gt;</span>
<span class="go">─────────── - ────────────────── - ───────── + P⋅&lt;-2⋅l + x&gt;   - ─────────────────</span>
<span class="go">     18               9                18                               18</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">shear_force</span><span class="p">()</span>
<span class="go">           -1                   -1          0                                  0</span>
<span class="go">  5⋅P⋅l⋅&lt;x&gt;     4⋅P⋅l⋅&lt;-3⋅l + x&gt;     5⋅P⋅&lt;x&gt;                0   13⋅P⋅&lt;-3⋅l + x&gt;</span>
<span class="go">- ─────────── + ────────────────── + ──────── - P⋅&lt;-2⋅l + x&gt;  + ────────────────</span>
<span class="go">       18               9               18                             18</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">bending_moment</span><span class="p">()</span>
<span class="go">           0                   0          1                                  1</span>
<span class="go">  5⋅P⋅l⋅&lt;x&gt;    4⋅P⋅l⋅&lt;-3⋅l + x&gt;    5⋅P⋅&lt;x&gt;                1   13⋅P⋅&lt;-3⋅l + x&gt;</span>
<span class="go">- ────────── + ───────────────── + ──────── - P⋅&lt;-2⋅l + x&gt;  + ────────────────</span>
<span class="go">      18               9              18                             18</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">slope</span><span class="p">()</span>
<span class="go">⎛         1          2               2⎞        ⎛         1          2               2⎞             ⎛   2                   1               2               2                  2⎞</span>
<span class="go">⎜5⋅P⋅l⋅&lt;x&gt;    5⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt; ⎟    0   ⎜5⋅P⋅l⋅&lt;x&gt;    5⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt; ⎟         0   ⎜P⋅l    4⋅P⋅l⋅&lt;-3⋅l + x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt;    13⋅P⋅&lt;-3⋅l + x&gt; ⎟         0</span>
<span class="go">⎜────────── - ──────── + ─────────────⎟⋅&lt;x&gt;    ⎜────────── - ──────── + ─────────────⎟⋅&lt;-l + x&gt;    ⎜──── - ───────────────── - ───────────── + ───────────── - ────────────────⎟⋅&lt;-l + x&gt;</span>
<span class="go">⎝    18          36            36     ⎠        ⎝    18          36            36     ⎠             ⎝ 18            9                 36              2                36       ⎠</span>
<span class="go">──────────────────────────────────────────── - ───────────────────────────────────────────────── + ───────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                    E⋅I                                               E⋅I                                                                    E⋅I</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">deflection</span><span class="p">()</span>
<span class="go">⎛         2          3               3⎞        ⎛         2          3               3⎞             ⎛     3      2                            2               3               3                  3⎞</span>
<span class="go">⎜5⋅P⋅l⋅&lt;x&gt;    5⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt; ⎟    0   ⎜5⋅P⋅l⋅&lt;x&gt;    5⋅P⋅&lt;x&gt;    5⋅P⋅&lt;-l + x&gt; ⎟         0   ⎜5⋅P⋅l    P⋅l ⋅(-l + x)   2⋅P⋅l⋅&lt;-3⋅l + x&gt;    5⋅P⋅&lt;-l + x&gt;    P⋅&lt;-2⋅l + x&gt;    13⋅P⋅&lt;-3⋅l + x&gt; ⎟         0</span>
<span class="go">⎜────────── - ──────── + ─────────────⎟⋅&lt;x&gt;    ⎜────────── - ──────── + ─────────────⎟⋅&lt;-l + x&gt;    ⎜────── + ───────────── - ───────────────── - ───────────── + ───────────── - ────────────────⎟⋅&lt;-l + x&gt;</span>
<span class="go">⎝    36         108           108     ⎠        ⎝    36         108           108     ⎠             ⎝  54           18                9                108              6               108       ⎠</span>
<span class="go">──────────────────────────────────────────── - ───────────────────────────────────────────────── + ─────────────────────────────────────────────────────────────────────────────────────────────────────────</span>
<span class="go">                    E⋅I                                               E⋅I                                                                             E⋅I</span>
</pre></div>
</div>
</section>
<section id="example-11">
<h3>Example 11<a class="headerlink" href="#example-11" title="Permalink to this headline">¶</a></h3>
<p>Any type of load defined by a polynomial can be applied to the beam. This
allows approximation of arbitrary load distributions. The following example
shows six truncated polynomial loads across the surface of a beam.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="mi">6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">Beam</span><span class="p">(</span><span class="mi">10</span><span class="o">*</span><span class="n">n</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">I</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
<span class="gp">... </span>    <span class="n">b</span><span class="o">.</span><span class="n">apply_load</span><span class="p">(</span><span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="mi">5</span><span class="o">**</span><span class="n">i</span><span class="p">),</span> <span class="mi">10</span><span class="o">*</span><span class="n">i</span> <span class="o">+</span> <span class="mi">5</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">10</span><span class="o">*</span><span class="n">i</span> <span class="o">+</span> <span class="mi">10</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plot</span><span class="p">(</span><span class="n">b</span><span class="o">.</span><span class="n">load</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="n">n</span><span class="p">))</span>  
</pre></div>
</div>
<p>(<a class="reference external" href="beam_problems-18.png">png</a>, <a class="reference external" href="beam_problems-18.hires.png">hires.png</a>, <a class="reference external" href="beam_problems-18.pdf">pdf</a>)</p>
<figure class="align-default">
<img alt="../../../_images/beam_problems-18.png" class="plot-directive" src="../../../_images/beam_problems-18.png" />
</figure>
</section>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../index.html">
              <img class="logo" src="../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Solving Beam Bending Problems using Singularity Functions</a><ul>
<li><a class="reference internal" href="#beam">Beam</a></li>
<li><a class="reference internal" href="#examples">Examples</a><ul>
<li><a class="reference internal" href="#example-1">Example 1</a></li>
<li><a class="reference internal" href="#example-2">Example 2</a></li>
<li><a class="reference internal" href="#example-3">Example 3</a></li>
<li><a class="reference internal" href="#example-4">Example 4</a></li>
<li><a class="reference internal" href="#example-5">Example 5</a></li>
<li><a class="reference internal" href="#example-6">Example 6</a></li>
<li><a class="reference internal" href="#example-7">Example 7</a></li>
<li><a class="reference internal" href="#example-8">Example 8</a></li>
<li><a class="reference internal" href="#example-9">Example 9</a></li>
<li><a class="reference internal" href="#example-10">Example 10</a></li>
<li><a class="reference internal" href="#example-11">Example 11</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="beam.html"
                        title="previous chapter">Beam (Docstrings)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../../plotting.html"
                        title="next chapter">Plotting</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/modules/physics/continuum_mechanics/beam_problems.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../plotting.html" title="Plotting"
             >next</a> |</li>
        <li class="right" >
          <a href="beam.html" title="Beam (Docstrings)"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="index.html" >Continuum Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Solving Beam Bending Problems using Singularity Functions</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/continuum_mechanics/beam_problems.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:58 GMT -->
</html>